import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';

import { ApiProperty } from "@nestjs/swagger";

@Entity({ name: 'front_request_log' })
export class FrontRequestLogEntity {

    @PrimaryGeneratedColumn()
    @ApiProperty({ description: '主键' })
    id: number

    @Column()
    @ApiProperty({ description: '用户id' })
    userId: number

    @Column()
    @ApiProperty({ description: '请求地址' })
    url: string

    @Column()
    @ApiProperty({ description: '请求方式' })
    method: string

    @Column()
    @ApiProperty({ description: '请求body' })
    body: string

    @Column()
    @ApiProperty({ description: '请求params' })
    params: string

    @Column()
    @ApiProperty({ description: 'ip地址' })
    ipAddress: string

    @Column()
    @ApiProperty({ description: '响应内容' })
    result: string

    @CreateDateColumn()
    @ApiProperty({ description: '创建时间' })
    createdTime: Date

    @UpdateDateColumn()
    @ApiProperty({ description: '更新时间' })
    updatedTime: Date

}